import { sysLogin } from '@/api/user.js'
// import { getToken, setToken } from '@/utils/auth.js'
const state = {
//   token: getToken() || ''
token:''
}
const mutations = {
  setToken(state, value) {
    state.token = value
    // setToken(value)
  }
}
const actions = {
  async toLogin({ commit }, value) {
    const res = await sysLogin(value)
    commit('setToken', res.data)
    console.log(res)
  }
}
const getters = {}
export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
